<?php


class Model extends Db{
	
	private
	$_table = 'user',
	$_primary,
	$_sql = '';
	
	public function select($rows = null){
		$rows = (empty($rows)) ? '*' : $rows;
		$this->_sql .= 'SELECT '.$rows.' FROM '.$this->_table;
		return $this;
	}
	
	public function where($where){
		$this->_sql .= ' WHERE '.$where;
		return $this;
	}
	
	public function finish(){
		$query = $this->prepare($this->_sql);
		$query->execute();
		$rs = $query->fetchAll(PDO::FETCH_ASSOC);
		return $rs;
	}
	
	public function _setModelData($data = array()){
		$this->_table = $data['table'];
		$this->_primary = $data['primary'];
		return $this;
	}
	
}